import type { App } from 'vue'
import { createStore } from 'vuex'

import user from './modules/user'
import route from './modules/route'
import app from './modules/app'
import setting from './modules/setting'
import designSetting from './modules/designSetting'

import getters from './getter'

const store = createStore({
  modules: {
    user,
    route,
    app,
    setting,
    designSetting
  },
  getters
})

export function setupStore(app: App<Element>) {
  app.use(store)
}

export default store
